from .basic import Agent
import requests

class NavAgent(Agent):

    def nav_list(self,params=None):
        """
        使用cookie访问
        返回访问结果
        :return:
        """
        res = requests.get(self._build_url("admin/nav/list"),params=params,headers=self._build_header(),cookies=self.cookies)
        return res
    def nav_group_add(self,data=None):
        res = requests.post(self._build_url("admin/nav/addgroup"), data=data, headers=self._build_header(),cookies=self.cookies)
        return res
    def nav_group_delete(self,data=None):
        res = requests.post(self._build_url("admin/nav/deletegroup"), data=data, headers=self._build_header(),cookies=self.cookies)
        return res
    def nav_group_edit(self,data=None):
        res = requests.post(self._build_url("admin/nav/editgroup"), data=data, headers=self._build_header(),cookies=self.cookies)
        return res
    def nav_add(self, data=None):
        res = requests.post(self._build_url("admin/nav/navadd"), data=data, headers=self._build_header(),cookies=self.cookies)
        return res
    def nav_edit(self, data=None):
        res = requests.post(self._build_url("admin/nav/navedit"), data=data, headers=self._build_header(),cookies=self.cookies)
        return res
    def nav_delete(self, data=None):
        res = requests.post(self._build_url("admin/nav/navdelete"), data=data, headers=self._build_header(),cookies=self.cookies)
        return res